<template>
  <div class="edit">
    <van-nav-bar class="edit-nav"
        title="个人信息"
        
        left-arrow
       @click-left="$router.back()"
      />

 <van-field v-model="nickname" clearable label="昵称" placeholder="请输入昵称" />


      <div class="edit-btn" style="text-align:center;padding: 20px ">
        <van-button @click="edit_nickname"  type="primary"   block>修改</van-button>
        </div>
  </div>
</template>

<script>
export default {
data(){
    return{
        nickname:'',
        userInfo:{},
    }
},
created(){
  this.nickname = this.$route.query.nickname
},
methods:{
  edit_nickname(){
    let {nickname} = this;

    if(nickname.trim().length === 0){
      this.$toast('不能为空')
      return
    }

    sessionStorage.setItem('nickname',nickname)
    setTimeout(v=>{
      this.$router.back()
    },300)
  }
}
}
</script>

<style>
/* .edit{
  position: relative;
} */

/* .edit-btn{
  position: absolute;
  left: 13px;
 
} */
.edit-nav{
    background: #07C060;
}
.van-nav-bar__title {
        color:white
    }
/* .edit-btn button{
  width: 350px;
} */
</style>